[MINI-OS] Fix a bug which prevented map_frames being used more than once.
authorsos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Tue, 25 Jul 2006 09:59:02 +0000 (10:59 +0100)
committersos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Tue, 25 Jul 2006 09:59:02 +0000 (10:59 +0100)
Found by John D. Ramsdell <ramsdell@mitre.org>

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
extras/mini-os/mm.c

index 980e32c0a2d45760b9011ec01af8ec5398301387..03fb3e9ab5ecf132070de780bd4ca4cffe44109f 100644 (file)
@@ -687,7 +687,7 @@ void *map_frames(unsigned long *f, unsigned long n)
     /* Find a run of n contiguous frames */
     for (x = 0; x <= 1024 - n; x += y + 1) {
         for (y = 0; y < n; y++)
-            if (demand_map_pgt[y] & _PAGE_PRESENT)
+            if (demand_map_pgt[x+y] & _PAGE_PRESENT)
                 break;
         if (y == n)
             break;